<template>
  <div>
    <el-dialog :visible.sync="visible" title="查看工单">
      <el-form ref="form2" :model="form2" label-width="100px">
        <el-form-item label="工单标题：" label-width="100px">{{
          form2.title
        }}</el-form-item>
        <el-form-item label="工单号   ：" label-width="100px">{{
          form2.olderNumber
        }}</el-form-item>
        <el-form-item label="客户姓名：" label-width="100px">{{
          form2.customer
        }}</el-form-item>
        <el-form-item label="联系方式：" label-width="100px">{{
          form2.tel
        }}</el-form-item>
        <el-form-item label="创建时间：" label-width="100px">{{
          form2.time
        }}</el-form-item>
        <el-form-item label="工单状态：" label-width="100px">
          <el-tag
            style="margin-left: 10px"
            :type="
              form2.state == '处理完毕'
                ? 'success'
                : form2.state == '受理中'
                ? ''
                : form2.state == '工人处理中'
                ? 'warning'
                : 'danger'
            "
            >{{ form2.state }}</el-tag
          >
        </el-form-item>
        <el-form-item label="已上传图片:" v-if="form2.imgUrl != null">
          <el-card :body-style="{ padding: '0px' }" style="width:500px">
            <img class="image" :src="require('D://ss/' + form2.imgUrl)" alt />
          </el-card>
        </el-form-item>

        <el-form-item label="工单详情：" style="width:800px">
          <el-input
            type="textarea"
            :disabled="true"
            :autosize="{ minRows: 3, maxRows: 4 }"
            v-model="form2.detail"
          ></el-input>
        </el-form-item>

        <el-form-item label="客户地址：" label-width="100px">{{
          form2.addr
        }}</el-form-item>

        <el-form-item label="紧急程度：" label-width="100px">
          <el-tag :type="form2.urgent == 2 ? 'danger' : 'success'">{{
            form2.urgent == 2 ? "紧急" : "普通"
          }}</el-tag>
        </el-form-item>
        <el-form-item>
          <el-button @click="visible = false" style="float:right"
            >确定</el-button
          >
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form2: {},
      visible: false,
    };
  },
  methods: {
    init(row) {   
       this.form2 = row;
      this.visible = true;
    },
  },
};
</script>

<style></style>
